const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
    app.use(
        '/api',
        createProxyMiddleware({
            // 后端接口域名
            target: 'http://xxxxxxx',
            changeOrigin: true,
            // logLevel: 'debug',
            pathRewrite: {
                "^/api": ""
            }
        })
    );
    app.use(
        '/apc',
        createProxyMiddleware({
            target: 'http://localhost:8000',
            changeOrigin: true,
            pathRewrite: {
                '^/apc': '',
            }
        })
    );
};